package com.sixth.system.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.sixth.core.annotation.OperaLog;
import com.sixth.core.entity.CheckItem;
import com.sixth.core.vo.R;
import com.sixth.system.vo.CheckItemVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Stu YH
 * @date Created in 2024/8/20 19:13
 * @description 检查费用
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("/system/checkItem")
@ApiOperation(value = "检查费用管理")
public class CheckItemController {
    @Autowired
    private com.sixth.system.service.checkItemService checkItemService;

    /**
     * 分页查询
     */
    @ApiOperation(value = "分页查询检查费用", notes = "根据条件分页查询检查费用")
    @RequestMapping("/listByPage")
    public R<IPage<CheckItem>> list(@RequestBody CheckItemVo checkItemVo) {
        return checkItemService.selectByPage(checkItemVo);
    }

    /**
     * 添加或修改
     */
    @ApiOperation(value = "进行添加或修改", notes = "添加或修改检查费用")
    @RequestMapping("/addUpdate")
    @OperaLog(value = "添加或修改检查费用", type = 2)
    public R addUpdate(@RequestBody CheckItem checkItem) {
        return checkItemService.addUpdate(checkItem);
    }

    @ApiOperation(value = "删除单条或多条数据", notes = "根据ID删除检查费用")
    @OperaLog(value = "删除检查费用", type = 3)
    @DeleteMapping("/deleteCheckItemByIds/{checkItemIds}")
    public R delete(@PathVariable Long[] checkItemIds) {
        return checkItemService.delete(checkItemIds);
    }

}
